export default {
  mounted(el: HTMLElement) {
    function useLastParents(node: HTMLElement, className: string): HTMLElement | null {
      while (node.parentElement) {
        if (node.classList.contains(className)) {
          return node
        }
        node = node.parentElement
      }
      return null
    }
    el.addEventListener('click', (event) => {
      console.log(el, event)
      const pNode = useLastParents(el, 'fs-full-screen')
      if (pNode) {
        if (pNode.classList.contains('is-full')) {
          pNode.classList.remove('is-full')
        } else {
          pNode.classList.add('is-full')
        }
      }
    })
  },
  updated(): void {}
}
